﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgentInfo.aspx.cs" Inherits="YY.Web.MyAgent.AgentInfo" %>

<%@ Import Namespace="YY.Common" %>

<!DOCTYPE html>
<html>
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>编辑店铺基本信息</title>
    <link href="/jQuery/PlugIns/artdialog/ui-dialog.css" rel="stylesheet" type="text/css" />
    <link href="/skin/default/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" charset="utf-8" src="/jQuery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/jQuery/PlugIns/Validform/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/jQuery/PlugIns/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/jQuery/PlugIns/webuploader/webuploader.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/jQuery/PlugIns/editor/kindeditor-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/js/uploader.js"></script>
    <script type="text/javascript" charset="utf-8" src="/js/laymain.js"></script>
    <script type="text/javascript" charset="utf-8" src="/js/common.js"></script>
    <script type="text/javascript">
        $(function () {
            //初始化表单验证
            $("#form1").initValidform();
            //初始化上传控件
            $(".upload-img").InitUploader({ sendurl: "/ajax/upload_ajax.ashx", swf: "/jQuery/PlugIns/webuploader/uploader.swf", filetypes: "gif,jpg,png,bmp" });
            //初始化编辑器
            var editorMini = KindEditor.create('#txtContent', {
                width: '100%',
                height: '250px',
                filterMode: false, //默认不过滤HTML
                resizeType: 1,
                uploadJson: '/ajax/upload_ajax.ashx?action=EditorFile&IsWater=1',
                items: [
                    'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                    'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                    'insertunorderedlist', '|', 'image', 'link', 'fullscreen']
            });

            $("#form1").Validform({
                tiptype: 2,
                datatype: {//传入自定义datatype类型【方式二】;
                    "idcard": function (gets, obj, curform, datatype) {
                        //该方法由佚名网友提供;

                        var Wi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1];// 加权因子;
                        var ValideCode = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2];// 身份证验证位值，10代表X;

                        if (gets.length == 15) {
                            return isValidityBrithBy15IdCard(gets);
                        } else if (gets.length == 18) {
                            var a_idCard = gets.split("");// 得到身份证数组   
                            if (isValidityBrithBy18IdCard(gets) && isTrueValidateCodeBy18IdCard(a_idCard)) {
                                return true;
                            }
                            return false;
                        }
                        return false;

                        function isTrueValidateCodeBy18IdCard(a_idCard) {
                            var sum = 0; // 声明加权求和变量   
                            if (a_idCard[17].toLowerCase() == 'x') {
                                a_idCard[17] = 10;// 将最后位为x的验证码替换为10方便后续操作   
                            }
                            for (var i = 0; i < 17; i++) {
                                sum += Wi[i] * a_idCard[i];// 加权求和   
                            }
                            valCodePosition = sum % 11;// 得到验证码所位置   
                            if (a_idCard[17] == ValideCode[valCodePosition]) {
                                return true;
                            }
                            return false;
                        }

                        function isValidityBrithBy18IdCard(idCard18) {
                            var year = idCard18.substring(6, 10);
                            var month = idCard18.substring(10, 12);
                            var day = idCard18.substring(12, 14);
                            var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
                            // 这里用getFullYear()获取年份，避免千年虫问题   
                            if (temp_date.getFullYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 || temp_date.getDate() != parseFloat(day)) {
                                return false;
                            }
                            return true;
                        }

                        function isValidityBrithBy15IdCard(idCard15) {
                            var year = idCard15.substring(6, 8);
                            var month = idCard15.substring(8, 10);
                            var day = idCard15.substring(10, 12);
                            var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
                            // 对于老身份证中的你年龄则不需考虑千年虫问题而使用getYear()方法   
                            if (temp_date.getYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 || temp_date.getDate() != parseFloat(day)) {
                                return false;
                            }
                            return true;
                        }

                    },
                    "empty": /^\s*$/,
                    "c": /^(\(\d{3}\)|\d{3}-)?\d{8}$/,
                }
            });
        });
    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
            <a href="../Center.aspx" class="home"><i></i><span>首页</span></a>
            <i class="arrow"></i>
            <span>编辑代理商基本信息</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--内容-->
        <div id="floatHead" class="content-tab-wrap">
            <div class="content-tab">
                <div class="content-tab-ul-wrap">
                    <ul>
                        <li><a class="selected" href="javascript:;">基本信息</a></li>
                        <li><a href="javascript:;">证书上传</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <dl>
                <dt>所在城市</dt>
                <dd>
                    <div id="city">
                    </div>
                    <span class="Validform_checktip">每座城市只有一位代理商</span>
                </dd>
            </dl>
            <dl>
                <dt>真实姓名</dt>
                <dd>
                    <asp:TextBox ID="txtTrueName" runat="server" CssClass="input normal" datatype="*1-8" sucmsg="可以使用"></asp:TextBox>
                    <span class="Validform_checktip">*真实姓名，中文名称，8个字符内</span></dd>
            </dl>
            <dl>
                <dt>用户性别</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblGender" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="1" Selected="True">男</asp:ListItem>
                            <asp:ListItem Value="0">女</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>登录密码</dt>
                <dd>
                    <asp:TextBox ID="txtPassword" runat="server" CssClass="input normal" TextMode="Password" datatype="*6-20" nullmsg="请设置密码" errormsg="密码范围在6-20位之间" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*登录的密码，至少6位</span></dd>
            </dl>
            <dl>
                <dt>确认密码</dt>
                <dd>
                    <asp:TextBox ID="txtPassword1" runat="server" CssClass="input normal" TextMode="Password" datatype="*" recheck="txtPassword" nullmsg="请再输入一次密码" errormsg="两次输入的密码不一致" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">*再次输入密码</span></dd>
            </dl>

            <dl>
                <dt>昵称</dt>
                <dd>
                    <asp:Label ID="lblUserName" runat="server"></asp:Label>
                </dd>
            </dl>
            <dl>
                <dt>上传头像</dt>
                <dd>
                    <asp:TextBox ID="txtImgUrl" runat="server" CssClass="input normal upload-path"></asp:TextBox>
                    <div class="upload-box upload-img"></div>
                </dd>
            </dl>
            <dl>
                <dt>手机号码</dt>
                <dd>
                    <asp:TextBox ID="txtMobile" runat="server" datatype="m" CssClass="input normal"></asp:TextBox>
                    <span class="Validform_checktip">请输入真实的手机号码，以便联系</span>
                </dd>
            </dl>
            <dl>
                <dt>电话号码</dt>
                <dd>
                    <asp:TextBox ID="txtTelphoneQh" Width="80" runat="server" datatype="empty|n" CssClass="input normal" sucmsg=" "></asp:TextBox>
                    -<asp:TextBox ID="txtTelphone" runat="server" datatype="empty|c" CssClass="input normal" nullmsg="请填写正确的电话号码" sucmsg=" "></asp:TextBox>
                    <span class="Validform_checktip">请输入真实的电话号码，以便联系</span>
                </dd>
            </dl>
            <dl>
                <dt>身份证号码</dt>
                <dd>
                    <asp:TextBox ID="txtIdNumber" runat="server" CssClass="input normal" datatype="idcard" nullmsg="请填写身份证号码" errormsg="您填写的身份证号码不对！"></asp:TextBox>
                    <span class="Validform_checktip">*请输入真实身份证，用于身份确认</span>
                </dd>
            </dl>
            <dl>
                <dt>邮箱</dt>
                <dd>
                    <asp:TextBox ID="txtEmail" runat="server" CssClass="input normal" datatype="empty|e" sucmsg=" " errormsg="您填写的邮箱不对！"></asp:TextBox>
                    <span class="Validform_checktip">请输入真实邮件地址，找回密码时用到</span>
                </dd>
            </dl>

            <dl>
                <dt>联系地址</dt>
                <dd>
                    <asp:TextBox ID="txtAddress" runat="server" CssClass="input" TextMode="MultiLine"></asp:TextBox>
                    <span class="Validform_checktip">255个字符以内</span>
                </dd>
            </dl>
        </div>

        <div class="tab-content" style="display: none">
            <dl>
                <dt>证件1</dt>
                <dd>
                    <asp:TextBox ID="txtDocuments1" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                </dd>
            </dl>
            <dl>
                <dt>证件2</dt>
                <dd>
                    <asp:TextBox ID="txtDocuments2" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                </dd>
            </dl>
            <dl>
                <dt>证件3</dt>
                <dd>
                    <asp:TextBox ID="txtDocuments3" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                </dd>
            </dl>
            <dl>
                <dt>证件4</dt>
                <dd>
                    <asp:TextBox ID="txtDocuments4" runat="server" CssClass="input normal upload-path" />
                    <div class="upload-box upload-img"></div>
                </dd>
            </dl>
        </div>
        <!--/内容-->

        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-wrap">
                <asp:Button ID="btnSubmit" runat="server" Text="保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <asp:Button ID="btnSubmitAudit" runat="server" Text="提交审核" CssClass="btn green" OnClick="btnSubmitAudit_Click" />
                <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
            </div>
        </div>
        <!--/工具栏-->
        <asp:HiddenField ID="HiddenField_Area_Value" runat="server" />
        <asp:HiddenField ID="HiddenField_City_Code" runat="server" />
    </form>
    <link href="../jQuery/Plugin/jautocombobox.css" rel="stylesheet" type="text/css" />
    <script src="../jQuery/Plugin/jAutoComboBox.js"></script>
    <script type="text/javascript">
        $(function() {
            var Value = $("#HiddenField_Area_Value").val();//省市文字
            $(".jAutoComboBox-address-input").val(Value);//.css("height", "36px").css("font-size", "26px").css("font-family", "微软雅黑")
        });
        AutoComboBox = $("#city").AutoComboBox({
            url: "/ajax/get_area_ajax.ashx",
            width: 300,
            item: { "province": "省份", "city": "城市" },
            expandAnimation: "show",
            shrinkAnimation: "slideUp",
            splitchar: ',',
            complete: function (value, text) {
                $("#HiddenField_Area_Value").val(value);//省市区文字
                $("#HiddenField_City_Code").val(text);//省市区编号
            }
        });

    </script>
</body>
</html>
